package com.ruoyi.aitcommon.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
//该文件会被自动加载
//@PropertySource(value = {"classpath:application-druid.yml"})

/**
 * 加载本地数据库配置
 * @author Administrator
 *
 */
@ConfigurationProperties(prefix = "spring.datasource.druid.master")
public class LocalDBConfig {
//	配置类，静态属性可以通过类直接获取，不用加载为bean
//	该方法可以使用在工具类读取配置文件上
	public static String url;
	public static String username;
	public static String password;
	
	public static String getUrl() {
		return url;
	}
//	注意：set方法不能是静态的，否则加载不了配置信息
	public void setUrl(String url) {
		LocalDBConfig.url = url;
	}
	public static String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		LocalDBConfig.username = username;
	}
	public static String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		LocalDBConfig.password = password;
	}
	
	
}
